#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    vector<int>vec(10);
    srand((unsigned) time(0));
    for(vector<int>::iterator it = vec.begin();it!=vec.end();it++){
        *it=rand() % 1000 + 1;
    }

    cout<<"未排序前： "<<endl;
    for(int i=0;i<vec.size();i++){
        cout<<vec[i]<<" ";
    }
    cout<<endl;
    sort(vec.begin(),vec.end());

    cout<<"排序后： "<<endl;
    for(int i=0;i<vec.size();i++){
        cout<<vec[i]<<" ";
    }
}